package com.itsm.controller;

import com.itsm.entity.ProcessApprove;
import com.itsm.service.mapper.ProcessApproveMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
public class ProcessAppController {

    @Autowired
    private ProcessApproveMapper processApproveMapper;

    /**
     * 获取提出人的全部工单
     * @param request
     * @return
     */
    @GetMapping("getProApp")
    public List<ProcessApprove> getProApp(HttpServletRequest request){
        return processApproveMapper.getAll((String) request.getSession().getAttribute("name"));
    }

    /**
     * 获取审批人的全部工单
     * @param request
     * @return
     */
    @GetMapping("getAllProApp")
    public List<ProcessApprove> getAllApp(HttpServletRequest request){
        return processApproveMapper.getAllApp((String) request.getSession().getAttribute("name"));
    }


}
